package com.youko.backstage.web;

import com.youko.backstage.bean.order.OrderSku;
import com.youko.backstage.dto.merchant.ResponseDto;
import com.youko.backstage.dto.order.OrderSkuDto;
import com.youko.backstage.mapper.commodity.OrderSkuMapper;
import com.youko.backstage.service.OrderSkuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: youko
 * @classname: OrderSkuController
 * @Description: some desc
 * @date: 2022/7/8 13:30
 */
@RestController
public class OrderSkuController {
    @Autowired
    OrderSkuService orderSkuService;

    @GetMapping("/merchant/order/selectAll")
    public List<OrderSkuDto> selectAllOrderSku(@RequestParam int merchantId){
        return orderSkuService.selectAllOrderSkuByMerchantId(merchantId);
    }

    @PostMapping("/merchant/order/updateOrderStatus")
    public ResponseDto updateOrderStatus(@RequestParam int orderSkuId){
        orderSkuService.updateSendStatusById(orderSkuId);

        ResponseDto responseDto=new ResponseDto();
        responseDto.setStatus(1);
        responseDto.setMsg("发货成功");
        return responseDto;
    }




}
